#ifndef URING_TCP_SERVER_H
#define URING_TCP_SERVER_H

#include <stdio.h>
#include <string.h>

#ifdef __linux__
#include <liburing.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <pthread.h>

#define ENTRES_LENGTH 1024
#define BUFFER_LENGTH 1024

#define EVENT_ACCEPT    0
#define EVENT_READ      1
#define EVENT_WRITE     2

// c语言打印开关
// #define PRINTFCMODE

struct CONN_INFO
{
    int fd;
    int event;
};

typedef int (*CallbackParser)(char *Recvbuff,char *Sendbuff);

void SetCallbackFun_Uring(int (*CallbackParser)(char *Recvbuff,char *Sendbuff));
void NetworkStart_Uring(pthread_t *tid);
#endif // __linux__

#endif